import { getItem } from './../utils/auth'
import i18n from 'i18next'
import enUsTrans from '@/assets/locales/en_US.json'
import zhCnTrans from '@/assets/locales/zh_CN.json'
import { initReactI18next } from 'react-i18next'

i18n.use(initReactI18next).init({
  resources: {
    en: {
      translation: enUsTrans
    },
    zh: {
      translation: zhCnTrans
    }
  },
  //默认语言
  fallbackLng: getItem('lang') || 'zh',
  debug: false,
  interpolation: {
    escapeValue: false
  }
})

export default i18n
